﻿@{
    Layout = null;
    ViewBag.Title = "产品列表";
    var list= ViewData["list"]  as Pay.TO.PagedResult<Pay.DTO.product_dto>;
    var domain = ViewData["url"] as string;
}
<html>

<head>
    <meta charset="UTF-8">
    <title>产品列表</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <meta name="format-detection" content="telphone=no, email=no" />
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <meta name="msapplication-tap-highlight" content="no">
    <link rel="stylesheet" type="text/css" href="~/Content/css/reset.css" />
    <link rel="stylesheet" type="text/css" href="~/Content/css/gelunbu.css" />
    <script src="~/Content/js/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        $(function () {
            var params = window.location.search.substring(window.location.search.length - 1, 1);
            $("ul li").click(function () {
                $("ul li").removeClass('active');
                $(this).addClass('active');
                if (this.innerText == "销量") {
                    window.location.href = "/Product/ProductList/?" + params + 1;
                }
                else if (this.innerText == "价格") {
                    window.location.href = "/Product/ProductList/?" + params + 2;
                }
                else if (this.innerText == "新品") {
                   
                    window.location.href = "/Product/ProductList/?" + params + 4;
                }
                else {
                    window.location.href = "/Product/ProductList/?" + params +0;
                }

            });
         
         
        });
       
    </script>
</head>

<body style="background: #F0F0F0;">
    <div class="pro_list">
        <div class="pro_list_top">
            <ul class="pro_list_cont">
                <li class="active">综合</li>
                <li >销量</li>
                <li>价格</li>
                <li>新品</li>
            </ul>
        </div>

        <ul class="related_container mt52" style="background: #fff;">
            @if (list.rows != null && list.rows.Count > 0)
                        {
                            foreach (var product in list.rows)
                            {
                                var src = domain + product.first_image;
            <li class="relate_item">
                <a href="/Product/ProductDetail/@product.id">
                    <img src="@src" class="pro_list_img" />

                    <p class="relate_small_title" style="text-align:center">@(product.name.Length > 10 ? product.name.Substring(0, 10) + ".." : product.name)</p>
                    <span class="relate_price" style="text-align:center">$@product.price</span>
                </a>
            </li>
}
            }

          
        </ul>

    </div>
</body>

</html>